package com.chen.controller;

import com.chen.entity.dto.SMSDto;
import com.chen.entity.vo.Result;
import com.chen.entity.vo.ResultCodeEnum;
import com.chen.service.SMSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/api/SMS")
public class SMSController {
    @Autowired
    private SMSService smsService;

    /**
     *   获取短信验证码
     * @param smsDto
     * @return
     */
    @PostMapping("/getCode")
    public Result getCode(@RequestBody SMSDto smsDto){
        smsService.getCode(smsDto);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
